<template>
  <div>
    <ul>
      <li>
        <span @click="btn">All_contacts</span>
      </li>
      <li>
        <span @click="btn">Alice</span>
      </li>
      <li>
        <span @click="btn">Bob</span>
      </li>
    </ul>
    <button @click="btn">随机显示</button>
    <router-view> </router-view>
  </div>
</template>

<script>
export default {
  name: "Case03Contacts",

  data() {
    return {
      list: ["all_contacts","alice","bob"],
    };
  },

  methods: {
    btn() {
      this.$router.push({
        name:this.list[parseInt(Math.random()*3)],
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>